package cn.qn.enums;

/**
 * 是否枚举
 */
public enum BooleanEnum {

    TRUE(1,"是","正常"),
    FALSE(0,"否","禁用");

    private Integer code;

    private String desc;

    private String desc2;

    private BooleanEnum(Integer code, String desc, String desc2) {
        this.code = code;
        this.desc = desc;
        this.desc2=desc2;
    }

    public Integer getCode() {
        return code;
    }

    public String getStringCode() {
        return code.toString();
    }

    public String getDesc() {
        return desc;
    }

    public String getDesc2() {
        return desc2;
    }

    public static String getDesc(Integer code) {
        for (BooleanEnum enums : BooleanEnum.values()) {
            if (enums.getCode().equals(code)) {
                return enums.getDesc();
            }
        }
        return "未知";
    }

    public static String getDesc2(Integer code) {
        for (BooleanEnum enums : BooleanEnum.values()) {
            if (enums.getCode().equals(code)) {
                return enums.getDesc2();
            }
        }
        return "未知";
    }
}
